package com.syt.service;

import cn.hutool.core.net.NetUtil;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;

/**
 * @author syt
 * 启动类
 */
@SpringBootApplication
@EnableEurekaClient
@EnableCaching
public class ServiceApplication {

    public static void main(String[] args) {
        int port = 8001;
        if(!NetUtil.isUsableLocalPort(port)) {
            System.err.printf("端口%d被占用了，无法启动%n", port );
            System.exit(1);
        }
        SpringApplication.run(ServiceApplication.class, args);
    }

}
